package dacp.etl.kafka.hdfs.connect.names;

import java.util.Map;
import java.util.UUID;

import org.apache.kafka.common.TopicPartition;

import com.google.common.base.Strings;
import com.google.common.collect.Maps;

public class SinglePartitionInfo implements FileNameFmt {
	private TopicPartition partition;
	private String directory;
	private String fmt;
	
	private Map<String, Object> context = Maps.newHashMap();
	
	public SinglePartitionInfo(String fmt){
		this.fmt = fmt;
	}
	
	public void setProperties(String key, Object val){
		this.context.put(key, val);
	}
	
	public SinglePartitionInfo(String fmt, TopicPartition partition, String directory){
		this.partition = partition;
		this.fmt = fmt;
		this.directory = directory;
	}

	
	public Map<String, String> parseFmt(){
		
		return null;
	}

	@Override
	public String fmtFileName() {
		
		if(!Strings.isNullOrEmpty(fmt)){
			
			
		}else{
			return UUID.randomUUID().toString();
		} 
		return null;
	}
	
	
}

enum FmtSegType {
	DIR("DIR") ;
	private String value;
	
	private FmtSegType(String value) {
        this.value = value; 
    }
	
	 public String getValue() {
         return value;
     }
}